public class Manager extends Employee {
    private double monthlySalary;
    private double bonus;

    public Manager(String name, String empId, double monthlySalary, double bonus) {
        super(name, empId);
        this.monthlySalary = monthlySalary;
        this.bonus = bonus;
    }

    @Override
    public double calculateSalary() {
        return monthlySalary + Math.max(bonus, 0);
    }

    @Override
    public String generatePaySlip() {
        return super.generatePaySlip() + String.format("\n明细：月薪%.2f元 + 奖金%.2f元",
                monthlySalary, bonus);
    }
}